import config from '@/config'

function getConfig(name) {
  if (/\./.test(name)) {
    let nameArr = name.split('.')
    let ret = config;

    for (let i in nameArr) {
      if (ret !== 'undefined') ret = ret[nameArr[i]]
      else break
    }
    return ret
  } else return config[name]

}

export default getConfig
